<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>

        // 无限传参   arguments

        // myPush(arr , v1 , v2 , v3 ,....)

        function myPush(arr) {
            console.log(arguments);   // arg[1] , arg[2] , arg[3]  ... 

            for (var i = 1; i < arguments.length; i++) {
                arr[arr.length] = arguments[i]
            }

            console.log(arr);
        }


        myPush([1, 2, 3], 4, 5);


        var arr = [1, 2, 3];
        arr[arr.length] = 4;   // 3
        arr[arr.length] = 5;   // 4

    </script>

</body>

</html>